downcast queue_elem to void then up to Waypoint
authorRobert Lipe <robertlipe@gpsbabel.org>
Thu, 5 Jul 2018 05:40:24 +0000 (00:40 -0500)
committerRobert Lipe <robertlipe@gpsbabel.org>
Thu, 5 Jul 2018 05:40:24 +0000 (00:40 -0500)
(yes, this is distasteful)

arcdist.cc
psitrex.cc
tpo.cc

index 9174f4b03aeb99347706a312f156745eba032998..0e2c19ec14da61e76b22e231d2f8a48035b6f266 100644 (file)
@@ -45,9 +45,10 @@ void ArcDistanceFilter::arcdist_arc_disp_wpt_cb(const Waypoint* arcpt2)
 #if NEWQ
     foreach (Waypoint* waypointp, waypt_list) {
 #else
-    queue* elem, * tmp;
+    queue* elem, *tmp;
     QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-      Waypoint* waypointp = (Waypoint*) elem;
+      void* vwaypointp = static_cast<void*>(elem);
+      Waypoint* waypointp = static_cast<Waypoint*>(vwaypointp);
 #endif
       double dist;
       extra_data* ed;
index eed700e28fbdfc1786b05319b7d86383c6ce2660..0a1d4319feab02192246ddf315f75419e1891fcc 100644 (file)
@@ -466,7 +466,8 @@ psit_routehdr_w(gbfile* psit_file, const route_head* rte)
     unsigned int rte_datapoints = 0;
     queue *elem, *tmp;
     QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-      testwpt = (Waypoint*)elem;
+      void* vwaypointp = static_cast<void*>(elem);
+      Waypoint* testwpt = static_cast<Waypoint*>(vwaypointp);
       if (rte_datapoints == 0) {
         uniqueValue = testwpt->GetCreationTime().toTime_t();
       }
@@ -612,7 +613,8 @@ psit_trackhdr_w(gbfile* psit_file, const route_head* trk)
       unsigned int trk_datapoints = 0;
       QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
         if (trk_datapoints == 0) {
-          Waypoint* testwpt = (Waypoint*)elem;
+          void* vwaypointp = static_cast<void*>(elem);
+          Waypoint* testwpt = static_cast<Waypoint*>(vwaypointp);
           uniqueValue = testwpt->GetCreationTime().toTime_t();
         }
         trk_datapoints++;
diff --git a/tpo.cc b/tpo.cc
index f3896490b01069049f2fae5a5dc38f1d952203e9..bab2f3728b19bfb0c42b135bebe7347edd7b6c1b 100644 (file)
--- a/tpo.cc
+++ b/tpo.cc
@@ -541,6 +541,7 @@ static void tpo_process_tracks()
     }
 
     unsigned char tmp = gbfgetc(tpo_file_in);
+    Q_UNUSED(tmp);
     // printf("Skipping unknown byte 0x%x after color\n",tmp);
 
     // byte for name length, then name